<template>

		<section class="jumbotron">
		  <h3 class="jumbotron-heading">Search Github Users</h3>
		  <div>
		    <input type="text" v-model="searchContent" @keyup.enter="toSearch" placeholder="enter the name you search"/>
		  </div>
		</section>

</template>

<script>
	
	export default  {
		name: 'Search',
		data() {
			return {
				searchContent: ""
			}
		},
		methods:{
			toSearch(){
				let searchContent = this.searchContent.trim()
				this.searchContent = ""
				if(!searchContent){
					return
				}
				this.$bus.$emit('searchList',searchContent)
			}
		}
	}
</script>